/* Copyright (c) HiSilicon (Shanghai) Technologies Co., Ltd. 2023-2023. All rights reserved.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 * Description: SLE UART sample of client. \n
 *
 * History: \n
 * 2023-04-03, Create file. \n
 */
#ifndef SLE_UART_CLIENT_H
#define SLE_UART_CLIENT_H

#include "sle_ssap_client.h"

typedef struct {
    uint16_t conn_id;                                // SLE connection id
    ssapc_find_service_result_t find_service_result; // Service discovery result
    sle_addr_t sle_remote_addr;                      // Remote SLE address
    ssapc_write_param_t sle_send_param;              // SLE write parameter
} sle_service_conn_info_t;

sle_service_conn_info_t *sle_get_service_conn_info(void);
uint8_t get_g_conn_count(void);
uint8_t get_g_client_id(void);

void sle_uart_client_init(ssapc_notification_callback notification_cb, ssapc_indication_callback indication_cb);

void sle_uart_start_scan(void);
void sle_uart_stop_scan(void);

void sle_uart_notification_cb(uint8_t client_id, uint16_t conn_id, ssapc_handle_value_t *data, errcode_t status);
void sle_uart_indication_cb(uint8_t client_id, uint16_t conn_id, ssapc_handle_value_t *data, errcode_t status);

void sle_uart_client_send_data(const uint8_t *buffer, uint16_t length);
#endif